import { configureStore } from "@reduxjs/toolkit";
import counterReducer from "../features/Counter/Counter";
import userReducer from "../features/user/userSlice";
export const store = configureStore({
  reducer: {
    counter: counterReducer,
    user: userReducer,
  },
});

//从store本身推断出' RootState '和' AppDispatch '类型
export type RootState = ReturnType<typeof store.getState>;
//推断类型:{posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch;
